﻿using Lanbt.Core.Entity.Enums;
using System.ComponentModel.DataAnnotations;

namespace Lanbt.Core.Entity.Dto.lanbt_power
{
    public class InsertPowerInput
    {
        /// <summary>
        /// 权限名称
        /// </summary>
        [Required(ErrorMessage = "请输入权限名称")]
        public string Name { get; set; }

        /// <summary>
        /// 菜单编码，用于后端权限控制
        /// </summary>
        public string? MenuCode { get; set; }

        /// <summary>
        /// 菜单父节点ID，方便递归遍历菜单
        /// </summary>
        [Required(ErrorMessage = "请选择父节点")]
        [Range(0, int.MaxValue, ErrorMessage = "请选择父节点")]
        public int? ParentID { get; set; }

        /// <summary>
        /// 节点类型，可以是文件夹、页面或者按钮类型
        /// </summary>
        [Required(ErrorMessage = "请选择节点类型")]
        [Range(1, 4, ErrorMessage = "请选择节点类型")]
        public PowerType? PowerType { get; set; }

        /// <summary>
        /// 图标URL
        /// </summary>
        public string? IconUrl { get; set; }

        /// <summary>
        /// 页面对应的地址，如果是文件夹或者按钮类型，可以为空
        /// </summary>
        public string? LineUrl { get; set; }

        /// <summary>
        /// 说明
        /// </summary>
        public string? Descript { get; set; }
    }
}
